//Source file: D:\\test\\com\\ce\\pms\\custservice\\model\\QuestionAndAnswer.java

package com.ce.pms.custservice.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.ce.pms.system.custservice.model.ReturnVisitItemDO;
import com.sitechasia.webx.core.model.IDomainObject;

/**
 * 实体名称:题目&答案 关联数据表:CE_QUESTION_AND_ANSWER
 *
 * @author yandawei
 * @CreateDate:2008-12-8
 */
@Entity
@Table(name = "CE_QUESTION_AND_ANSWER")
public class QuestionAndAnswer implements IDomainObject {

	/**
	 * 答题结果ID
	 */
	@Id
	@GeneratedValue
	@Column(name="QUESTION_AND_ANSWER_ID")
	private Long keyword;

	/**
	 * 回访结果: 1. 如果是选择型回访项目,保存答案的code,多选用","分开 2. 如果是发挥型回访项目,保存答案叙述.
	 */
	@Column(name = "ANSWER", nullable = false, length = 200)
	private String answer;

	/**
	 * 备注
	 */
	@Column(name = "REMARK", length = 100)
	private String remark;

	/**
	 * 回访项目
	 */
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "RETURN_VISIT_ITEM_ID")
	private ReturnVisitItemDO returnVisitItemDO;

	/**
	 * 问卷调查
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="QUESTIONAIRE_ID")
	private AbstractQuestionaire abstraQuestionaire;
	/**
	 * @roseuid 4937AB32001F
	 */
	public QuestionAndAnswer() {

	}

	/**
	 * @param answer -
	 *            回访结果
	 * @param remark -
	 *            备注
	 * @param returnVisitItemDO -
	 *            回访项目
	 * @param abstraQuestionaire -
	 *           问卷调查
	 * @return com.ce.pms.custservice.model.QuestionAndAnswer
	 * @roseuid 492BC9E301D4
	 */
	public QuestionAndAnswer(String answer, String remark,
			ReturnVisitItemDO returnVisitItemDO,AbstractQuestionaire abstraQuestionaire) {
		this.answer = answer;
		this.remark = remark;
		this.returnVisitItemDO = returnVisitItemDO;
		this.abstraQuestionaire = abstraQuestionaire;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public ReturnVisitItemDO getReturnVisitItemDO() {
		return returnVisitItemDO;
	}

	public void setReturnVisitItemDO(ReturnVisitItemDO returnVisitItemDO) {
		this.returnVisitItemDO = returnVisitItemDO;
	}

	public AbstractQuestionaire getAbstraQuestionaire() {
		return abstraQuestionaire;
	}

	public void setAbstraQuestionaire(AbstractQuestionaire abstraQuestionaire) {
		this.abstraQuestionaire = abstraQuestionaire;
	}

	public Long getKeyword() {
		return keyword;
	}

	public void setKeyword(Long keyword) {
		this.keyword = keyword;
	}

}
